package com.study.config;

import com.study.dao.UserDAO;
import com.study.dao.UserDAOImpl;
import com.study.service.UserService;
import com.study.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.*;
import org.springframework.stereotype.Service;

import java.time.temporal.ValueRange;
import java.util.prefs.BackingStoreException;

@Configuration
/*@ComponentScan(basePackages = "com.study.scan", excludeFilters = {
        @ComponentScan.Filter(type = FilterType.ANNOTATION, value = Service.class),
        @ComponentScan.Filter(type = FilterType.ASPECTJ, pattern = "*..User1")
})*/
@ComponentScan(
        basePackages = "com.study.scan",
        useDefaultFilters = false,
        includeFilters = {
            @ComponentScan.Filter(type = FilterType.ANNOTATION, value = {
                    Service.class
            })
            // @ComponentScan.Filter(type = FilterType.ASPECTJ, pattern = {
            //         "*..User1"
            // })
       }
)
public class AppConfig2 {

    @Bean
    public UserDAO userDAO() {
        return new UserDAOImpl();
    }
}
